<?php

    /**
     *      [Discuz!] (C)2001-2099 Comsenz Inc.
     *      This is NOT a freeware, use is subject to license terms
     *      $Id: table_mobile_setting.php 31281 2012-08-03 02:29:27Z zhangjie $
     */

    if (!defined('IN_DISCUZ')) {
        exit('Access Denied');
    }

    class table_cloud_app_alipay extends discuz_table {

        public function __construct() {
            $this->_table = 'cloud_app_alipay';
            $this->_pk = 'id';
            parent::__construct();
        }

        //插入数据库
        public function insert($arr) {
            return DB::insert($this->_table, $arr, true);
        }

        //更新数据库
        public function update($id, $data) {
            $id = intval($id);
            if (!$data) {
                return;
            }
            return DB::update($this->_table, $data, DB::field($this->_pk, $id));
        }

        //查找某条记录
        public function fetch_info($id) {
            $id = intval($id);
            return DB::fetch_first("SELECT * FROM %t WHERE id=%d", array($this->_table, $id));
        }

        public function fetch_info_by_caid($caid){
            $caid = intval($caid);
            return DB::fetch_first("SELECT * FROM ".DB::table($this->_table)." WHERE caid=".$caid);
        }

    }